<j:lbuttons
  [submitBtnVisible]="false"
  [backBtnVisible]="false"
  [approveBtnVisible]="false"
  [unapproveBtnVisible]="false"
  [approveDividerVisible]="false"
  [exportBtnVisible]="false"
  [printBtnVisible]="false"
  [exportDividerVisible]="false"
  [searchDetailBtnVisible]="false"
  [deleteBtnDisabledFn]="isDeleteButtonDisabledFn"
  (newBtnClick)="new()"
  (deleteBtnClick)="delete()"
  (refreshBtnClick)="refresh()"
  (searchBtnClick)="search($event)"
>
  <nz-divider afterRefreshBtn nzType="vertical"></nz-divider>
  <button nz-button afterRefreshBtn nzType="link" (click)="editHostFeatures()">Host功能管理</button>
</j:lbuttons>
<nz-card class="main-card">
  <nz-table
    #basicTable
    nzSize="middle"
    [nzData]="models"
    [nzTotal]="totalCount"
    nzShowSizeChanger
    nzShowQuickJumper
    [nzFrontPagination]="false"
    [(nzPageIndex)]="currentPage"
    [(nzPageSize)]="maxResultCount"
    [nzPageSizeOptions]="[10, 15, 50, 100, 1000, 5000]"
    [nzShowTotal]="paginationTotalTemplate"
    [nzShowSizeChanger]="true"
    [nzScroll]="{ x: '100%', y: '100%' }"
  >
    <ng-template #paginationTotalTemplate let-total>
      <div style="flex: 1">
        <div *ngIf="selectedCount > 0">
          <span
            nz-icon
            [nzType]="'info-circle'"
            [nzTheme]="'fill'"
            style="font-size: 14px; color: #08c"
          ></span>
          共选中 <b>{{ selectedCount }}</b> 条记录
          <nz-button-group nzSize="small" class="form-multactions">
            <button nz-button nzType="primary" nzGhost (click)="clearSelect()">取消</button>
          </nz-button-group>
        </div>
      </div>
      <div>共 {{ pageCount }} 页 {{ total }} 条记录</div>
    </ng-template>
    <thead>
      <tr>
        <th
          nzWidth="60px"
          [nzLeft]="true"
          [nzChecked]="isAllSelected"
          [nzIndeterminate]="indeterminate"
          (nzCheckedChange)="targetAllSelect()"
        ></th>
        <th nzWidth="400px">租户名称</th>
        <th nzWidth="80px" [nzRight]="true">操作</th>
      </tr>
    </thead>
    <tbody>
      <tr
        *ngFor="let model of basicTable.data; trackBy: track.by('id')"
        (click)="targetModelSelect(model)"
      >
        <td
          [nzLeft]="true"
          [nzChecked]="isModelSelected(model)"
          (nzCheckedChange)="targetModelSelect(model)"
        ></td>
        <td>
          <a (click)="view(model, $event)">{{ model.name }}</a>
        </td>
        <td [nzRight]="true">
          <a (click)="editFeatures(model, $event)">功能管理</a>
        </td>
      </tr>
    </tbody>
  </nz-table>
</nz-card>
